<html>
<head><meta charset="utf-8"><title>https://github.com/rust-lang/rust/issues/65180 · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html">https://github.com/rust-lang/rust/issues/65180</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="178284281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178284281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178284281">(Oct 16 2019 at 12:43)</a>:</h4>
<p><span class="user-mention" data-user-id="127859">@Taylor Cramer</span> <br>
this issue caused by an unexpected "skip" inside  <a href="https://github.com/rust-lang/rust/blob/bfc58789a4d08519e93aef517d5ffe17c113ba8e/src/librustc_typeck/check/generator_interior.rs#L24" target="_blank" title="https://github.com/rust-lang/rust/blob/bfc58789a4d08519e93aef517d5ffe17c113ba8e/src/librustc_typeck/check/generator_interior.rs#L24">InteriorVistor::record</a>:<br>
when it trying to record type <code>Ok(hyper::service::service_fn(|| { ... }</code>, <code>region_scope_tree.yield_in_scope(scope)</code> returns <code>None</code>, then this type skipped the  whole recording  procedure as the debug just printed <code>generator_interior: attempting to record type ...</code> followed by <code>no type in expr ...</code> immediately(but we actually <strong><em>have</em></strong> <code>TyKind::Infer</code>( printed as <code>_</code>) here</p>
<div class="codehilite"><pre><span></span>[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type std::result::Result&lt;_, _&gt; Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))) src/lib.rs:25:13: 31:16
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))), count = 5, span = Some(src/lib.rs:25:13: 31:16)
[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type std::result::Result&lt;_, _&gt; Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))) src/lib.rs:25:13: 31:16
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))), count = 5, span = Some(src/lib.rs:25:13: 31:16)
[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type _ Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })) src/lib.rs:24:20: 32:10
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })), count = 6, span = Some(src/lib.rs:24:20: 32:10)
[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type _ Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })) src/lib.rs:24:20: 32:10
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })), count = 6, span = Some(src/lib.rs:24:20: 32:10)
[DEBUG rustc_typeck::check::generator_interior] types in generator [], span = src/lib.rs:24:20: 32:10
[DEBUG rustc_typeck::check::generator_interior] types in generator after region replacement {}, span = src/lib.rs:24:20: 32:10
</pre></div>


<p>NOTE: rustc should error after <code>generator_interior: attempting to record type _ Some(Node(230)) ...</code></p>
<p>I did some experiments to catch <code>type _ Some(Node(230))</code> and apply <code>need_type_info_in_generator</code> without yield_data span_note on it, rustc complained for <code>need type info</code> at <code>Ok</code> span as expected.</p>
<p>Should rustc stop here? if so, what's the error as no yield found? cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="178305239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178305239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178305239">(Oct 16 2019 at 16:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116773">@csmoe</span> what do you mean by a "skip"?</p>



<a name="178305247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178305247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178305247">(Oct 16 2019 at 16:27)</a>:</h4>
<p>and what makes it "unexpected"?</p>



<a name="178305257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178305257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178305257">(Oct 16 2019 at 16:27)</a>:</h4>
<p>Is it that the type is already recorded?</p>



<a name="178318869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178318869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178318869">(Oct 16 2019 at 19:01)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="116773">csmoe</span> what do you mean by a "skip"?</p>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I mean rustc should error on <code>type _</code> at Span(src/lib.rs:25:13 25:15) <code>Ok(service_fn(|| {...})</code><br>
as you can search in <a href="https://paste.rs/vEe" target="_blank" title="https://paste.rs/vEe">this</a> debug output with <code>remained unresolved_type</code>, we have 2 unresolved type in the <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=40ce31e308e1dfeaa161ccd2f9194d72" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=40ce31e308e1dfeaa161ccd2f9194d72">snippet</a>:<br>
1. span(23:25 23:30) serve(...)<br>
2. span(25:13 25:15)  Ok(...)<br>
the first one was already reported, but the 2nd wasn't.</p>



<a name="178319008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178319008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178319008">(Oct 16 2019 at 19:03)</a>:</h4>
<p>the debug output was generated from my branch <a href="https://github.com/csmoe/rust/commit/b73099fc89add82eeb288507f2762e4da2e5d5c8" target="_blank" title="https://github.com/csmoe/rust/commit/b73099fc89add82eeb288507f2762e4da2e5d5c8">https://github.com/csmoe/rust/commit/b73099fc89add82eeb288507f2762e4da2e5d5c8</a></p>



<a name="178320262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178320262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178320262">(Oct 16 2019 at 19:20)</a>:</h4>
<p><a href="/user_uploads/4715/ktvy7abWJrv_f5DgNBf4QjkQ/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a> <br>
the log is hard to "parse", so rg'd for you</p>
<div class="message_inline_image"><a href="/user_uploads/4715/ktvy7abWJrv_f5DgNBf4QjkQ/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/ktvy7abWJrv_f5DgNBf4QjkQ/pasted_image.png"></a></div>



<a name="178652586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/https%3A//github.com/rust-lang/rust/issues/65180/near/178652586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frust.2Fissues.2F65180.html#178652586">(Oct 21 2019 at 13:05)</a>:</h4>
<p>(deleted)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>